<template>
  <ContentWrap>
    <el-col :span="24" class="mt5">
      <el-descriptions :column="2">
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="商品编码" />
          </template>
          {{ data?.no }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="商品名称" />
          </template>
          {{ data?.name }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="价格(元)" />
          </template>
          {{ data?.supplyPrice }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="次数" />
          </template>
          {{ data?.num }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="创建时间" />
          </template>
          {{ formatDate(data?.createTime) }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="商品封面" />
          </template>
          <el-image style="width: 100px; height: 100px" :src="data?.matchmakerCover" fit="fill" />
        </el-descriptions-item>
      </el-descriptions>
      <el-descriptions :column="1">
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="商品详情" />
          </template>
          <!-- 展示 HTML 内容 -->
          <div v-dompurify-html="data.productIntroduct" style="width: 600px"></div>
        </el-descriptions-item>
      </el-descriptions>
    </el-col>
  </ContentWrap>
</template>
<script setup lang="ts">
import { formatDate } from '@/utils/formatTime'

const { data } = defineProps<{ data }>()
</script>
<style scoped lang="scss">
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
